<template>
    <a class="item-panel" href="javascript:void;" v-link="{name:'detail',params: {postId: item.id}}">
        <div class='search-player'>
            <span class='player-pic'><img :src="item.authorAvatarUrl | avatar" alt="头像" ></span>
            <span class='player-nickname'>{{item.authorNickname | nickname}}</span>
            <span class='player-time'>{{item.addTime | date_md }}</span>
        </div>
        <div class="search-times">
            <div class='search-time-diff-date' v-if="item.teamTimeRange.begin.slice(0,5) == item.teamTimeRange.end.slice(0,5)"><span class="time-left">{{item.teamTimeRange.begin | date_mdw }}</span> <span v-if="item.teamTimeRange.begin.slice(5,10) !== item.teamTimeRange.end.slice(5,10)" class="time-right">{{item.teamTimeRange.end | date_mdw}}</span></div>
             <div class='search-time-diff-date' v-else><span class="time-left">{{item.teamTimeRange.begin | date_ymdw }}</span> <span class="time-right">{{item.teamTimeRange.end | date_ymdw}}</span></div>
            <div class='search-time-hours'><span>{{item.teamTimeRange.begin | date_h }}</span><em class="icon-arrow"></em><span>{{item.teamTimeRange.end | date_h }}</span></div>
            <div class='search-player-number'>活动人数: {{item.members.length | number}}/{{item.teamMemberMaxCount | number}}</div>
        </div>
        <div class="search-des">
            <p class='des-text'>
                {{item.content}}
            </p>
            <div v-if = "item.images.length && item.images.length > 0" >
                <div class="des-pic" v-if= "item.images.length <= 4">
                    <div class="pic-item" v-for="img in item.images" track-by="$index">
                        <img :src='img.url' alt="图片">
                    </div>
                </div>
                <div class="des-pic" v-if= "item.images.length > 4">
                    <div class="pic-item" ><img :src='item.images[0]' alt="图片"></div>
                    <div class="pic-item" ><img :src='item.images[1]' alt="图片"></div>
                    <div class="pic-item" ><img :src='item.images[2]' alt="图片"></div>
                    <div class="pic-item"><div class="des-img-more">+{{item.images.length - 3}}</div></div>
                </div>
            </div>
            <div class="des-tag">
                <div class='tag-item' v-for="tag in item.tags">{{tag.name}}</div>
            </div>
            <!-- <div class="des-comment">
                评论 12
            </div> -->
        </div>
    </a>
</template>
<script>
import VueRouter from 'vue-router'
import '../../filter/filter'
export default {
    name:'RecruitView',
    props:{
        item:Object
    }
}
</script>
